#include <iostream>
using namespace std;

class Person
{
public:
  // Person()
  // {
  //   cout << "Person 默认构造函数调用" << endl;
  // }

  Person(int age)
  {
    cout << "Person 有参构造函数调用" << endl;
    m_age = age;
  }

  // Person(const Person &p)
  // {
  //   cout << "Person 拷贝构造函数调用" << endl;
  //   m_age = p.m_age;
  // }

  ~Person()
  {
    cout << "Person 析构构造函数调用" << endl;
  }

  int m_age;
};

void test01()
{
  Person p1;
  p1.m_age = 18;

  Person p2(p1);

  cout << "p2的年龄为：" << p2.m_age << endl;
}

void test02() {
  Person p(12);
}

int main(int argc, char const *argv[])
{
  // test01();
  test02();

  return 0;
}